/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.ofbiz.eclipse.model.webapp.SiteConf.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.ofbiz.eclipse.model.webapp.SiteConf.AuthType;
import org.ofbiz.eclipse.model.webapp.SiteConf.CertType;
import org.ofbiz.eclipse.model.webapp.SiteConf.DirectRequestType;
import org.ofbiz.eclipse.model.webapp.SiteConf.ExternalViewType;
import org.ofbiz.eclipse.model.webapp.SiteConf.HttpsType;
import org.ofbiz.eclipse.model.webapp.SiteConf.SecurityType;
import org.ofbiz.eclipse.model.webapp.SiteConf.SiteConfPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Security Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.ofbiz.eclipse.model.webapp.SiteConf.impl.SecurityTypeImpl#getAuth <em>Auth</em>}</li>
 *   <li>{@link org.ofbiz.eclipse.model.webapp.SiteConf.impl.SecurityTypeImpl#getCert <em>Cert</em>}</li>
 *   <li>{@link org.ofbiz.eclipse.model.webapp.SiteConf.impl.SecurityTypeImpl#getDirectRequest <em>Direct Request</em>}</li>
 *   <li>{@link org.ofbiz.eclipse.model.webapp.SiteConf.impl.SecurityTypeImpl#getExternalView <em>External View</em>}</li>
 *   <li>{@link org.ofbiz.eclipse.model.webapp.SiteConf.impl.SecurityTypeImpl#getHttps <em>Https</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SecurityTypeImpl extends EObjectImpl implements SecurityType {
	/**
	 * The default value of the '{@link #getAuth() <em>Auth</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAuth()
	 * @generated
	 * @ordered
	 */
	protected static final AuthType AUTH_EDEFAULT = AuthType.FALSE;

	/**
	 * The cached value of the '{@link #getAuth() <em>Auth</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAuth()
	 * @generated
	 * @ordered
	 */
	protected AuthType auth = AUTH_EDEFAULT;

	/**
	 * This is true if the Auth attribute has been set.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	protected boolean authESet;

	/**
	 * The default value of the '{@link #getCert() <em>Cert</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCert()
	 * @generated
	 * @ordered
	 */
	protected static final CertType CERT_EDEFAULT = CertType.FALSE;

	/**
	 * The cached value of the '{@link #getCert() <em>Cert</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCert()
	 * @generated
	 * @ordered
	 */
	protected CertType cert = CERT_EDEFAULT;

	/**
	 * This is true if the Cert attribute has been set.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	protected boolean certESet;

	/**
	 * The default value of the '{@link #getDirectRequest() <em>Direct Request</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDirectRequest()
	 * @generated
	 * @ordered
	 */
	protected static final DirectRequestType DIRECT_REQUEST_EDEFAULT = DirectRequestType.TRUE;

	/**
	 * The cached value of the '{@link #getDirectRequest() <em>Direct Request</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDirectRequest()
	 * @generated
	 * @ordered
	 */
	protected DirectRequestType directRequest = DIRECT_REQUEST_EDEFAULT;

	/**
	 * This is true if the Direct Request attribute has been set.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	protected boolean directRequestESet;

	/**
	 * The default value of the '{@link #getExternalView() <em>External View</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getExternalView()
	 * @generated
	 * @ordered
	 */
	protected static final ExternalViewType EXTERNAL_VIEW_EDEFAULT = ExternalViewType.TRUE;

	/**
	 * The cached value of the '{@link #getExternalView() <em>External View</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getExternalView()
	 * @generated
	 * @ordered
	 */
	protected ExternalViewType externalView = EXTERNAL_VIEW_EDEFAULT;

	/**
	 * This is true if the External View attribute has been set.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	protected boolean externalViewESet;

	/**
	 * The default value of the '{@link #getHttps() <em>Https</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getHttps()
	 * @generated
	 * @ordered
	 */
	protected static final HttpsType HTTPS_EDEFAULT = HttpsType.FALSE;

	/**
	 * The cached value of the '{@link #getHttps() <em>Https</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getHttps()
	 * @generated
	 * @ordered
	 */
	protected HttpsType https = HTTPS_EDEFAULT;

	/**
	 * This is true if the Https attribute has been set.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	protected boolean httpsESet;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected SecurityTypeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return SiteConfPackage.Literals.SECURITY_TYPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AuthType getAuth() {
		return auth;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAuth(AuthType newAuth) {
		AuthType oldAuth = auth;
		auth = newAuth == null ? AUTH_EDEFAULT : newAuth;
		boolean oldAuthESet = authESet;
		authESet = true;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SiteConfPackage.SECURITY_TYPE__AUTH, oldAuth, auth, !oldAuthESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void unsetAuth() {
		AuthType oldAuth = auth;
		boolean oldAuthESet = authESet;
		auth = AUTH_EDEFAULT;
		authESet = false;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.UNSET, SiteConfPackage.SECURITY_TYPE__AUTH, oldAuth, AUTH_EDEFAULT, oldAuthESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isSetAuth() {
		return authESet;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CertType getCert() {
		return cert;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCert(CertType newCert) {
		CertType oldCert = cert;
		cert = newCert == null ? CERT_EDEFAULT : newCert;
		boolean oldCertESet = certESet;
		certESet = true;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SiteConfPackage.SECURITY_TYPE__CERT, oldCert, cert, !oldCertESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void unsetCert() {
		CertType oldCert = cert;
		boolean oldCertESet = certESet;
		cert = CERT_EDEFAULT;
		certESet = false;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.UNSET, SiteConfPackage.SECURITY_TYPE__CERT, oldCert, CERT_EDEFAULT, oldCertESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isSetCert() {
		return certESet;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DirectRequestType getDirectRequest() {
		return directRequest;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDirectRequest(DirectRequestType newDirectRequest) {
		DirectRequestType oldDirectRequest = directRequest;
		directRequest = newDirectRequest == null ? DIRECT_REQUEST_EDEFAULT : newDirectRequest;
		boolean oldDirectRequestESet = directRequestESet;
		directRequestESet = true;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SiteConfPackage.SECURITY_TYPE__DIRECT_REQUEST, oldDirectRequest, directRequest, !oldDirectRequestESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void unsetDirectRequest() {
		DirectRequestType oldDirectRequest = directRequest;
		boolean oldDirectRequestESet = directRequestESet;
		directRequest = DIRECT_REQUEST_EDEFAULT;
		directRequestESet = false;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.UNSET, SiteConfPackage.SECURITY_TYPE__DIRECT_REQUEST, oldDirectRequest, DIRECT_REQUEST_EDEFAULT, oldDirectRequestESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isSetDirectRequest() {
		return directRequestESet;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ExternalViewType getExternalView() {
		return externalView;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setExternalView(ExternalViewType newExternalView) {
		ExternalViewType oldExternalView = externalView;
		externalView = newExternalView == null ? EXTERNAL_VIEW_EDEFAULT : newExternalView;
		boolean oldExternalViewESet = externalViewESet;
		externalViewESet = true;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SiteConfPackage.SECURITY_TYPE__EXTERNAL_VIEW, oldExternalView, externalView, !oldExternalViewESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void unsetExternalView() {
		ExternalViewType oldExternalView = externalView;
		boolean oldExternalViewESet = externalViewESet;
		externalView = EXTERNAL_VIEW_EDEFAULT;
		externalViewESet = false;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.UNSET, SiteConfPackage.SECURITY_TYPE__EXTERNAL_VIEW, oldExternalView, EXTERNAL_VIEW_EDEFAULT, oldExternalViewESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isSetExternalView() {
		return externalViewESet;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public HttpsType getHttps() {
		return https;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setHttps(HttpsType newHttps) {
		HttpsType oldHttps = https;
		https = newHttps == null ? HTTPS_EDEFAULT : newHttps;
		boolean oldHttpsESet = httpsESet;
		httpsESet = true;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SiteConfPackage.SECURITY_TYPE__HTTPS, oldHttps, https, !oldHttpsESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void unsetHttps() {
		HttpsType oldHttps = https;
		boolean oldHttpsESet = httpsESet;
		https = HTTPS_EDEFAULT;
		httpsESet = false;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.UNSET, SiteConfPackage.SECURITY_TYPE__HTTPS, oldHttps, HTTPS_EDEFAULT, oldHttpsESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isSetHttps() {
		return httpsESet;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case SiteConfPackage.SECURITY_TYPE__AUTH:
				return getAuth();
			case SiteConfPackage.SECURITY_TYPE__CERT:
				return getCert();
			case SiteConfPackage.SECURITY_TYPE__DIRECT_REQUEST:
				return getDirectRequest();
			case SiteConfPackage.SECURITY_TYPE__EXTERNAL_VIEW:
				return getExternalView();
			case SiteConfPackage.SECURITY_TYPE__HTTPS:
				return getHttps();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case SiteConfPackage.SECURITY_TYPE__AUTH:
				setAuth((AuthType)newValue);
				return;
			case SiteConfPackage.SECURITY_TYPE__CERT:
				setCert((CertType)newValue);
				return;
			case SiteConfPackage.SECURITY_TYPE__DIRECT_REQUEST:
				setDirectRequest((DirectRequestType)newValue);
				return;
			case SiteConfPackage.SECURITY_TYPE__EXTERNAL_VIEW:
				setExternalView((ExternalViewType)newValue);
				return;
			case SiteConfPackage.SECURITY_TYPE__HTTPS:
				setHttps((HttpsType)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case SiteConfPackage.SECURITY_TYPE__AUTH:
				unsetAuth();
				return;
			case SiteConfPackage.SECURITY_TYPE__CERT:
				unsetCert();
				return;
			case SiteConfPackage.SECURITY_TYPE__DIRECT_REQUEST:
				unsetDirectRequest();
				return;
			case SiteConfPackage.SECURITY_TYPE__EXTERNAL_VIEW:
				unsetExternalView();
				return;
			case SiteConfPackage.SECURITY_TYPE__HTTPS:
				unsetHttps();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case SiteConfPackage.SECURITY_TYPE__AUTH:
				return isSetAuth();
			case SiteConfPackage.SECURITY_TYPE__CERT:
				return isSetCert();
			case SiteConfPackage.SECURITY_TYPE__DIRECT_REQUEST:
				return isSetDirectRequest();
			case SiteConfPackage.SECURITY_TYPE__EXTERNAL_VIEW:
				return isSetExternalView();
			case SiteConfPackage.SECURITY_TYPE__HTTPS:
				return isSetHttps();
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (auth: ");
		if (authESet) result.append(auth); else result.append("<unset>");
		result.append(", cert: ");
		if (certESet) result.append(cert); else result.append("<unset>");
		result.append(", directRequest: ");
		if (directRequestESet) result.append(directRequest); else result.append("<unset>");
		result.append(", externalView: ");
		if (externalViewESet) result.append(externalView); else result.append("<unset>");
		result.append(", https: ");
		if (httpsESet) result.append(https); else result.append("<unset>");
		result.append(')');
		return result.toString();
	}

} //SecurityTypeImpl
